package cn.gcyl.module.biz.dal.mysql;

import cn.gcyl.framework.mybatis.core.mapper.BaseMapperX;
import cn.gcyl.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.gcyl.module.biz.dal.dataobject.SysMemberUserDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 会员 User Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface SysMemberUserMapper extends BaseMapperX<SysMemberUserDO> {

    default SysMemberUserDO selectByMobile(String mobile) {
        return selectOne(SysMemberUserDO::getMobile, mobile);
    }

    default List<SysMemberUserDO> selectListByNicknameLike(String nickname) {
        return selectList(new LambdaQueryWrapperX<SysMemberUserDO>()
                .likeIfPresent(SysMemberUserDO::getNickname, nickname));
    }

}
